﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package org.aswing.plaf.basic {
    import org.aswing.*;
    import org.aswing.geom.*;
    import org.aswing.plaf.*;
    import org.aswing.event.*;
    import org.aswing.graphics.*;

    public class BasicToolTipUI extends BaseComponentUI {

        protected var tooltip:JToolTip;
        protected var label:JLabel;

        override public function installUI(_arg1:Component):void{
            this.tooltip = JToolTip(_arg1);
            this.installDefaults();
            this.initallComponents();
            this.installListeners();
        }
        protected function getPropertyPrefix():String{
            return ("ToolTip.");
        }
        protected function installDefaults():void{
            var _local1:String = this.getPropertyPrefix();
            LookAndFeel.installColorsAndFont(this.tooltip, _local1);
            LookAndFeel.installBorderAndBFDecorators(this.tooltip, _local1);
            LookAndFeel.installBasicProperties(this.tooltip, _local1);
            var _local2:Array = (getInstance((this.getPropertyPrefix() + "filters")) as Array);
            this.tooltip.filters = _local2;
        }
        protected function initallComponents():void{
            var _local1:JToolTip = this.tooltip;
            _local1.setLayout(new BorderLayout());
            this.label = new JLabel(_local1.getTipText());
            this.label.setOpaque(false);
            this.label.setFont(null);
            this.label.setForeground(null);
            this.label.setUIElement(true);
            _local1.append(this.label, BorderLayout.CENTER);
        }
        protected function installListeners():void{
            this.tooltip.addEventListener(ToolTipEvent.TIP_TEXT_CHANGED, this.__tipTextChanged);
        }
        override protected function paintBackGround(_arg1:Component, _arg2:Graphics2D, _arg3:IntRectangle):void{
        }
        private function __tipTextChanged(_arg1:ToolTipEvent):void{
            this.label.setText(this.tooltip.getTipText());
        }
        override public function uninstallUI(_arg1:Component):void{
            this.uninstallDefaults();
            this.uninstallListeners();
            this.uninstallComponents();
        }
        protected function uninstallDefaults():void{
            LookAndFeel.uninstallBorderAndBFDecorators(this.tooltip);
            this.tooltip.filters = [];
        }
        protected function uninstallComponents():void{
            this.tooltip.remove(this.label);
            this.label = null;
        }
        protected function uninstallListeners():void{
            this.tooltip.removeEventListener(ToolTipEvent.TIP_TEXT_CHANGED, this.__tipTextChanged);
        }

    }
}//package org.aswing.plaf.basic 
